<template>
  <div>
    <img
      src="https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fpic1.win4000.com%2Fwallpaper%2F2020-09-28%2F5f714a326c0ea.jpg&refer=http%3A%2F%2Fpic1.win4000.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1672217973&t=19f4f9b4e075959de8b78b967812608f"
      alt=""
      v-show="flag"
    />
    <button @click="fn">点击以后显示和隐藏</button>
  </div>
</template>

<script>
export default {
  data() {
    return {
      flag: true,
    }
  },
  methods: {
    fn() {
      this.flag = !this.flag
    },
  },
}
</script>

<style scoped>
img {
  width: 250px;
  height: 250px;
}
</style>
